<!--
 Copyright 2018 IBM All Rights Reserved.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

	  http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->
<!DOCTYPE html>
<html>
<style>
	@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700");
html {
  font-family: sans-serif;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 10em;
}
h1 {
  font-size: 2em;
  margin: 0.67em 0;
}
a {
  color: #2780E3;
  text-decoration: none;
}
a:hover,
a:focus {
  color: #165ba8;
  text-decoration: underline;
}
a:focus {
  outline: thin dotted;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}
</style>
<head>
	<meta charset="utf-8">
	<title>Single Page Apps for GitHub Pages</title>
	<script type="text/javascript">

		let l = window.location;

		// firstly need to check if we are in a loop
		if (!l.search.match(/redirect=true/)){
			let newUrl = l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '')
			+ '/release-1.4/index.html?redirect=true'

			let mapping = [FILENAME__MAPPING]
			let release = "release-1.4";

			// look up the maping
			let requestedPage = l.pathname.split('/').slice(1)[0]

			// if (mapping.indexOf(requestedPage)>-1) {
				// newUrl = l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '')
				// +'/release-1.4/fabric-shim.' + requestedPage+'?redirect=true';
			// }

			console.log(newUrl);
			l.replace(newUrl);
		}

	</script>
</head>
<body>
<h1>Sorry, a suitable documentation page can not be found</h1>
<h2>Please consult the main <a href="https://fabric-sdk-node.readthedocs.io/en/release-1.2/">Hyperledger Fabric documentation</a></h2>
</body>
</html>
